/***********************
*DESC:初始化各个楼层的配置数据
*Author:wff 
*Date:2015-04-27
*
************************/
var CurrfloorMap = new Map();
var CurrAreaNameMap = new Map();
var CurrAlarmElemMap = new Map();
var AppjslStr = {};
var Devjsl = {};
var Scenesjsl = {};
var Reactorjsl = {};
var addfloor = [];
var addarea = [];
var addelem = [];
var InitMcmdArry = [];
var CurrFloorArry = [];
var CurrAreaArry = [];
var CurrFloorAreaArry = [];
var CurrElemArry = [];
//var CurrElemCMDTypeArry = [];
var CurrElemCMDArry = [];
var CurrElemTriggerArry = [];
var CurrElemTriggerValArry = [];
var CurrSceneGroupArry = [];
var CurrScenesArry = [];
var CurrAlarmsArry = [];
/*存储楼层数据*/
function addfloorDataToArry(arry, id, name) {
        arry.push({ "id": id, "name": name });
		CurrfloorMap.put(id,name);
}
/*存储对应楼层的区域数据*/
function addAreaDataToArry(arry, fid, id, name) {
        arry.push({ "floorid": fid, "atype": id, "name": name });
		
}
function InitFloorSelecthtml(selectarry,selectId)
{
		
		$("#" + selectId).empty();
		var selectedValue;
		var length = selectarry.length;
		
		$.each(selectarry, function (index, item) {
			if(index == 0)
				selectedValue = item.id;
			$("#" + selectId).append("<option value="+item.id+">"+item.name+"</option>"); 
	});
	if(currfloorid == '' || currfloorid == 'undefind'){
		$("#" + selectId).val(selectedValue);
		$("#" + selectId + " option[value='" + selectedValue + "']").attr("selected","selected");
	}
	else{
		$("#" + selectId).val(currfloorid);
		$("#" + selectId + " option[value='" + currfloorid + "']").attr("selected","selected");
	}
	
}
function InitareaSelecthtml(selectarry,selectId)
{
		
		$("#" + selectId).empty();
		var selectedValue;
		var length = selectarry.length;
		
		$.each(selectarry, function (index, item) {
			if(index == 0)
				selectedValue = item.id;
			$("#" + selectId).append("<option value="+item.id+">"+item.name+"</option>"); 
	});
	
		$("#" + selectId).val(selectedValue);
		$("#" + selectId + " option[value='" + selectedValue + "']").attr("selected","selected");
	
	
}
